<template>
  <div class="header_bar">
    <div class="bar_left">
      <span
        class="iconfont bar_title"
        :class="store.state.IsMenu ? 'icon-choutizhankai' : 'icon-choutishouqi'"
        @click="setMenu"
      ></span>
      <span @click="setMenu" class="bar_title">
        <i :class="store.state.IsMenu ? 'el-icon-s-unfold' : 'el-icon-s-fold'"
      /></span>
      <el-breadcrumb separator="/">
        <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
        <el-breadcrumb-item>活动详情</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <div class="bar_right">
      <el-dropdown>
        <div class="bar_avatar">
          <el-avatar
            src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"
          ></el-avatar>
          <span>18888888888</span>
        </div>
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item>退出</el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
    </div>
  </div>
</template>

<script setup>
import { onMounted } from 'vue';
import { useStore } from 'vuex';
const store = useStore();
const setMenu = () => {
  store.commit('setIsMenu', !store.state.IsMenu);
};
onMounted(() => {});
</script>
<style scoped lang="scss">
.header_bar {
  height: 100%;
  display: flex;
}

.bar_left {
  display: flex;
  height: 100%;
  align-items: center;
}

.bar_title {
  cursor: pointer;
  font-size: 20px;
  margin: 0 8px;
}

.el-breadcrumb {
  margin-left: 8px;
  font-size: 14px;
}

.bar_right {
  display: flex;
  height: 100%;
  align-items: center;
  margin-left: auto;
}

.bar_avatar {
  display: flex;
  align-items: center;
  margin-right: 12px;
  font-size: 14px;
}

.el-avatar {
  width: 24px;
  height: 24px;
  margin-right: 12px;
}
</style>
